<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程分析</title>
</head>
<body>
    <div style="display: flex; flex-direction: column">
        <div>
            <form action="/test" method="post">
                <input type="text" name="year" >
                <input type="submit" value="提交" onclick="change(1)">
            </form>
            <br>
            <iframe src="http://127.0.0.1:8080/yearClass"
                    width="850px" height="400px"   frameborder="1/0"
                    name="" id="iframe-a" scrolling="no"></iframe>
        </div>
        <div>
            <iframe src="http://127.0.0.1:8080/overall"
                    width="850px" height="400px"   frameborder="1/0"
                    name="" id="iframe-b" scrolling="no"></iframe>
        </div>
        <div>
            <iframe src="http://127.0.0.1:8080/overalltwo"
                    width="850px" height="400px"   frameborder="1/0"
                    name="" id="iframe-c" scrolling="no"></iframe>
        </div>
        <div>
            <form action="/test1" method="post">
                <input type="text" name="sex" >
                <input type="submit" value="提交" onclick="change(2)">
            </form>
            <br>
            <iframe src="http://127.0.0.1:8080/sex"
                    width="850px" height="400px"   frameborder="1/0"
                    name="" id="iframe-d" scrolling="no"></iframe>
        </div>
    </div>
</body>
<script>

    function change(e) {
        if(e==1){
            document.getElementById('iframe-a').contentWindow.location.reload();
        }
        else if(e==2){
            document.getElementById('iframe-d').contentWindow.location.reload();
        }
    }
</script>
</html>